Skip to main content

Section: Decoupled

This section defines "decoupled modules". These are modules with the properties of toplevel modules, but they can be inserted also as submodules into specific slots (Type:= DECOUPLED) of other modules. Modules cannot be "toplevel" and "decoupled" at the same time.

"Decoupled modules" are generated using the section Decoupled in the module declaration. The section Decoupled is nearly identical to the section Toplevel; however, only one of these sections is allowed in a module declaration.

SEC Decoupled                                       //optional: yes, modifier: [UPDATE]
    GVL_Name := <GVL name>;                         //optional: yes, type: literal
    Default_Application := <default application>;   //optional: yes, type: QID
    Default_POUPool := <TRUE/FALSE>;                //optional: yes, type: BoolFlag
    Pragmas := [<pragma1>, <pragma2>,...];          //optional: yes, type: Pragmalist
    Toplevel_Insertable := <TRUE/FALSE>;            //optional: yes, type: BoolFlag
    SEC Standard_Task : <task name>                 //optional: yes, modifier: [HIDE,UPDATE]
            Name := <task name>;                        //optional: no, type: ID
            Desc := <task description>;                 //optional: no, type: Text)
            Flags:= <flag>;                             //optional: no, type: StdTaskFlags)
    END_SEC
    SEC Custom_Task : <task name>                   //optional: yes, modifier: [UPDATE]
            Priority := <priority>;                     //optional: no, type: Subrange(0 .. 31)
            Interval :=  <interval>;                    //optional: no, type: TimeLiteral)
            Flags:= <flag>;                             //optional: no, type: CustomTaskFlags)
    END_SEC
END_SEC

Details regarding the syntax of definition types are described in the chapter for module declaration.

Specification: The specification of the section Decoupled corresponds to the description of the section Toplevel. In addition, the following parameters can be defined:

  • Toplevel_Insertable defines whether a "decoupled submodule" can also be inserted toplevel like a toplevel module.

Note: A "decoupled module" should define and implement a respective proxy. The proxy should implement the same interface as the "decoupled module". If the parent module instance lies under another controller as the "decoupled" module instance, then the "decoupled" module instance can still be inserted into this slot via its proxy.